package com.peaksport.pkms.oauth.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.peaksport.framework.base.entity.CoreBaseEntity;
import com.peaksport.framework.uuid.PKEntityType;

import lombok.Getter;
import lombok.Setter;

@SuppressWarnings("serial")
@Entity
@Table(name = "CT_OAuth_RefreshToken")
@Getter
@Setter
public class RefreshTokenEntity extends CoreBaseEntity {
	
	@ManyToOne(fetch= FetchType.LAZY)
	@JoinColumn(name="FClientId", nullable=false)
	private ClientEntity client;
	@Column(name="FCreateTime")
	private Date createTime;
	@Column(name="FExpireTime")
	private long expireTime;
	@Column(name="FIsExpire")
	private boolean isExpire = false;
	
	@Override
	public PKEntityType getEntityType() {
		return PKEntityType.create("23DE176B");
	}

}
